package com.alibaba.citrus.ots.sales.plan.functions.salesplan;

import com.alibaba.citrus.ots.common.util.SpringContextUtil;
import com.alibaba.citrus.ots.sales.plan.repository.SalesPlanCustomerStatRepository;
import com.alibaba.citrus.ots.sales.plan.sdo.SalesPlanStatCustomerSDO;
import lombok.Getter;
import lombok.Setter;

/**
 * @author yuhailin
 * @description:
 * @date 2021-09-27 10:42
 */
public class SalesPlanCustomerStatEntity {
    @Getter
    @Setter
    private SalesPlanStatCustomerSDO salesPlanCustomerStatSDO;

    private static SalesPlanCustomerStatRepository salesPlanCustomerStatRepository;

    static {
        salesPlanCustomerStatRepository = SpringContextUtil.getBean(SalesPlanCustomerStatRepository.class);
    }
    public static SalesPlanCustomerStatEntity of(SalesPlanStatCustomerSDO salesPlanCustomerStatSDO) {
        SalesPlanCustomerStatEntity entity = new SalesPlanCustomerStatEntity();
        entity.setSalesPlanCustomerStatSDO(salesPlanCustomerStatSDO);
        return entity;
    }

    public String planCustomerSave(){
        return salesPlanCustomerStatRepository.planCustomerSave(this.salesPlanCustomerStatSDO);
    }
    public Boolean planCustomerEdit(){
        return salesPlanCustomerStatRepository.editSalesPlanCustomer(this.salesPlanCustomerStatSDO);
    }

}
